﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ICIA.ARojas.Visual.Intermedio
{
    public class NotificaLlamadaEventArgs : EventArgs
    {
        public string URL { get; set; }
        public NotificaLlamadaEventArgs(string url)
        {
            this.URL = url;
        }
    }


    public class Notificar
    {

        public event EventHandler<NotificaLlamadaEventArgs> OnNotificar;
        public event EventHandler OnCerrado;

        private static Notificar instancia;
        public static Notificar Current
        {
            get
            {
                if (instancia == null) instancia = new Notificar();
                return instancia;
            }
        }

        public void LlamarReporte(string url)
        {
            if (OnNotificar != null)
                OnNotificar(this, new NotificaLlamadaEventArgs(url));
        }

        public string Servidor
        {
            get { return "http://localhost:1209/Reportes/"; }
        }        

        public void NotificarCerrado()
        {
            if (OnCerrado != null)
                OnCerrado(this, EventArgs.Empty);
        }


    }
}
